<?php
$CI =& get_instance();
$CI->load->library('pagination');
$CI->load->model('Model_store', 'model_store');
$t1 = unserialize($content['t1']);
$types = empty($t1['types']) ? null : $t1['types'];

$limit = 10;
$total = $CI->model_store->browse_count(null, null, null);
$offset = 0;
$per_page = $CI->uri->segment(4,0);
if($per_page < $total){
	$offset = $per_page;
}
$stores = $CI->model_store->browse(null, null, $limit, $offset, 'is_special');
$config['base_url'] = site_url(array('c'=>'home', 'm'=>'search'));
$config['uri_segment'] = 4;
$config['total_rows'] = $total;
$config['per_page'] = $limit;
$CI->pagination->initialize($config); 

?>
<div class="left-col">
<h3 style="padding-bottom: 7px;"> We've found <span style='color: #FF0000;'> <?=$CI->pagination->total_rows;?> Nail Salons </span> near your location </h3>
<table width="100%" cellpadding="0" cellspacing="1" >
<tbody>
<?php foreach($stores as $item):?>
<tr>
	<td width="210">
		<a href="<?=site_url(array('c' => 'home', 'm' => 'store_detail', 'nav'=> 1, 'id' => $item['id']))?>">
			<img width= "200" height="120" src="<?=$item['image']?>" alt="<?=$item['company_name']?>"/>
		</a>
		
	</td>
	<td width="210">
	<div class='address'>
	<h5><a href="<?=site_url(array('c' => 'home', 'm' => 'store_detail', 'nav'=> $node['id'], 'id' => $item['id']))?>"><?=$item['company_name']?></a></h5>
			<h4><p><?=$item['address']?></p>
			<p><?=$item['city']?> ,<?=$item['state']?> <?=$item['zipcode']?></p>
			<p><?=$item['home_phone']?></p></h4>
	</div
	</td>
	<td style="background-color: #F9F9F9;">
		<div class="desc">
			<label><?=lang('business-hour');?></label>: <p><?=$item['business_hour']?></p>
			<p><a href="<?=site_url(array('c' => 'home', 'm' => 'store_detail', 'nav'=> 1, 'id' => $item['id']))?>">more...</a></p>
		</div>	
	</td>
<?php endforeach;?>
<tbody>
</table>
<div class="pagination"><?=$CI->pagination->create_links();?></div>
</div>